/**
 * 
 */
package com.xinthe.payment.utils;

/**
 * @author Sudarshan
 *
 */
public class ValidationUtil {

	public static boolean isValidCard(String cardNumber) {
		boolean flag = false;
		if (cardNumber.matches("\\d{16}")) {
			flag = true;
			return flag;
		} else {
			return flag;
		}
	}

	public static boolean isValidCardType(String cardType) {
		boolean flag = false;
		if (!(cardType.equalsIgnoreCase("Credit_Card") || cardType
				.equalsIgnoreCase("Debit_Card"))) {

			return flag;
		} else {
			flag = true;
			return flag;
		}
	}

	public static boolean isValidAmount(String amount) {
		boolean flag = false;
		double amt = Double.parseDouble(amount);

		if (amt == 0) {
			return flag;
		} else {
			flag = true;
			return flag;
		}
	}
}
